# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=persistencesniper
pkgver=v1.17.1.r0.g13006aa
pkgrel=1
groups=('blackarch' 'blackarch-defensive' 'blackarch-windows')
pkgdesc='Hunt persistences implanted in Windows machines.'
url='https://github.com/last-byte/PersistenceSniper'
arch=('any')
license=('MIT')
makedepends=('git')
source=("git+https://github.com/last-byte/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/share/windows/$pkgname"

  cp -a --no-preserve=ownership PersistenceSniper/* \
    "$pkgdir/usr/share/windows/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

